package com.creatshare.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.creatshare.bean.User;
import com.creatshare.dao.UserDao;
import com.creatshare.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Resource
	private UserDao userDao;

	@Override
	public User getUserByUserNameAndPassword(String userName, String password) {
		return userDao.getUserByUserNameAndPassword(userName, password);
	}

	@Override
	public int insert(User user) {
		try {
			return userDao.insert(user);
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}
	}

}
